Skip to content

Conversation

@valeriosetti
Copy link
Contributor

@valeriosetti valeriosetti commented Nov 12, 2025

Description

Resolves #10453

PR checklist

  • changelog not required because: no visible change for the end user
  • development PR not required because: it's this one
  • TF-PSA-Crypto PR not required because: no change there
  • framework PR not required
  • 3.6 PR not required because: no backport
  • tests not required because: code behavior is expected to remain the same so already existing tests should be enough to prove that this change is OK.

@valeriosetti valeriosetti added needs-ci Needs to pass CI tests needs-preceding-pr Requires another PR to be merged first needs-reviewer This PR needs someone to pick it up for review size-s Estimated task size: small (~2d) priority-high High priority - will be reviewed soon labels Nov 12, 2025
@valeriosetti valeriosetti added needs-review Every commit must be reviewed by at least two team members, and removed needs-preceding-pr Requires another PR to be merged first labels Dec 2, 2025
@valeriosetti valeriosetti force-pushed the issue10453 branch 3 times, most recently from c8b2c7e to 0a6589e Compare December 3, 2025 12:24
@valeriosetti valeriosetti removed the needs-ci Needs to pass CI tests label Dec 4, 2025
The check being removed is already done few lines above so there is no
need to repeat it twice.

Signed-off-by: Valerio Setti <[email protected]>
Add a simple helper to convert from PK sigalg to PSA algorithm. This is
handy when calling mbedtls_pk_can_do_psa() knowing the PK sigalg and the
used MD type.

This is being added in a separate file because it's meant to be consumed
by both ssl and x509 modules. It was not added to tf-psa-crypto because
this is only needed on the mbedtls repo and doing so reduce interdependencies
between the repos.

Signed-off-by: Valerio Setti <[email protected]>
Checking that parent PK type is OK is definitely faster than computing
an hash, so invert the checks.

Signed-off-by: Valerio Setti <[email protected]>
#if defined(MBEDTLS_SSL_PROTO_TLS1_2) && \
defined(PSA_WANT_KEY_TYPE_ECC_PUBLIC_KEY)
if (ssl->tls_version == MBEDTLS_SSL_VERSION_TLS1_2 &&
mbedtls_pk_can_do(&chain->pk, MBEDTLS_PK_ECKEY)) {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there a reason we still need this usage?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oops, nope, that completely missed my checks :(

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

needs-review Every commit must be reviewed by at least two team members, needs-reviewer This PR needs someone to pick it up for review priority-high High priority - will be reviewed soon size-s Estimated task size: small (~2d)

Projects

Development

Successfully merging this pull request may close these issues.

Remove use of pk_can_do()

2 participants